const initialState = {
  list: [],
};

export default function newsReducer(state = initialState, { type, payload }) {
  switch (type) {
    // 4. reducer定义保存数据的分支逻辑
    case 'news/setList':
      return {
        ...state,
        list: [...payload],
      };

    default:
      return state;
  }
}
